package com.wcs.exam.common.base;

import cn.hutool.core.map.MapUtil;
import jakarta.servlet.http.HttpServletRequest;

import java.util.Enumeration;
import java.util.Map;

/**
 * 基础类
 *
 * @author wcs
 */
public class BaseController extends BaseBiz {

    protected Map<String, Object> getHeaders(HttpServletRequest request) {
        Enumeration<String> headers = request.getHeaderNames();
        Map<String, Object> headerMap = MapUtil.newHashMap();
        while (headers.hasMoreElements()) {
            String headerName = headers.nextElement();
            headerMap.put(headerName, request.getHeader(headerName));
        }
        return headerMap;
    }
}
